#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-

import os

def build(bld):
    obj = bld.new_task_gen('cxx')
    obj.source="""
        instructions.cpp
        registers.cpp
        alias.cpp
        processor.cpp
        pipeline.cpp
        interface.cpp
        decoder.cpp
        memory.cpp
        externalPorts.cpp
        irqPorts.cpp
        externalPins.cpp
    """
    obj.uselib = 'BOOST BOOST_FILESYSTEM BOOST_SYSTEM BOOST_THREAD SYSTEMC TLM TRAP'
    obj.includes = '.'
    obj.export_incdirs = '.'
    obj.name = 'accAT'
    obj.target = 'accAT'

    obj = bld.new_task_gen('cxx', 'program')
    obj.source='main.cpp'
    obj.includes = '.'
    obj.uselib = 'BOOST BOOST_PROGRAM_OPTIONS BOOST_THREAD BOOST_FILESYSTEM BOOST_SYSTEM SYSTEMC TLM TRAP BFD LIBERTY'
    import sys
    if sys.platform == 'cygwin':
        obj.env.append_unique('CPPFLAGS', '-D__USE_W32_SOCKETS')
        obj.uselib += ' WINSOCK'
    obj.add_objects = 'accAT'
    obj.name = 'accAT_main'
    obj.target = 'accAT'

